% -*- LaTeX -*-
%
% @file Specification.tex
% @brief OpenRTM-aist developers guide [Specification]
% @date $Date: 2005-05-12 09:06:21 $
% @author Noriaki Ando <n-ando@aist.go.jp>
%
% Copyright (C) 2003-2005
%     Task-intelligence Research Group,
%     Intelligent Systems Research Institute,
%     National Institute of
%         Advanced Industrial Science and Technology (AIST), Japan
%     All rights reserved.
%
% $Id$
%

\chapter{RTM Specification}

OpenRTM\--aist $B$O(B $BFHN)9T@/K!?M?7%(%M%k%.!<!&;:6H5;=QE}9g3+H/5!9=(B (NEDO) $B$N(B21$B@$5*%m%\%C%H%A%c%l%s%8%W%m%0%i%`!V%m%\%C%H5!G=H/8=$N$?$a$KI,MW$JMWAG5;=Q3+H/!W$K$*$$$FI8=`2=:n6H$,?J$a$i$l$F$$$k(B RTM Specification $B$N%$%s%?!<%U%'!<%9;EMM$K=`5r$9$k<BAu$N$R$H$D$H$7$F3+H/$5$l$^$7$?!#(B

$B%W%m%8%'%/%H$G$O!"%m%\%C%H$N$?$a$NI8=`E*$J%W%i%C%H%U%)!<%`$H$J$k$h$&$J%_%I%k%&%(%"$r3+H/$9$k$?$a$K!"%$%s%?!<%U%'!<%9%l%Y%k$G$N;EMM:vDj$HI8=`2=:n6H$,9T$o$l(B RTM Specification $B$H$7$F$^$H$a$i$l$^$7$?!#(B

$BK\>O$G$O(B OpenRTM\--aist $B$N%$%s%?!<%U%'!<%9;EMM$N4p$H$J$C$F$$$k(B RTM Specification $B$K$D$$$F!";EMM$H<BAu$N4X78$r@bL@$7$^$9!#(B
$B$^$?!"(BIDL$B$N%$%s%?!<%U%'!<%9Dj5A$r<($7$J$,$i!"(BRTM Specification $B%$%s%?!<%U%'!<%9;EMM$H(B OpenRTM\--aist $B$K$h$jFH<+$K3HD%$5$l$?%$%s%?!<%U%'!<%9$r$=$l$>$l<($7$J$,$i!"$3$l$i$N0c$$$K$D$$$F@bL@$7$^$9!#(B

\section{OpenRTM\--aist $B$H(B RTM Specification}

RTM$B$OFHN)9T@/K!?M?7%(%M%k%.!<!&;:6H5;=QE}9g3+H/5!9=(B (NEDO) $B$N(B21$B@$5*%m%\%C%H%A%c%l%s%8%W%m%0%i%`!V%m%\%C%H5!G=H/8=$N$?$a$KI,MW$JMWAG5;=Q3+H/!W$K1w$$$F!"%M%C%H%o!<%/%m%\%C%H$N%W%i%C%H%U%)!<%`$H$J$k%_%I%k%&%(%"5;=Q$r3+H/$9$kL\E*$N85$K!"FHN)9T@/K!?M;:6H5;=QAm9g8&5f=j(B (National Institute of Advanced Industrial Science and Technology: AIST)$B!">>2<EE9)3t<02q<R(B (Matsushita Electric Works, Ltd.: MEW)$B$HF|K\%m%\%C%H9)6H2q(B (Japan Robot Association: JARA) $B$N(B3$B<T(B ($B?^(B~\ref{fig:ResaerchOrganization}) $B$K$h$j!"J?@.(B14$BG/EY$+$iJ?@.(B16$BG/EY$^$G$N(B3$BG/4V$N%W%m%8%'%/%H$H$7$F8&5f3+H/$,9T$o$l$^$7$?!#(B

\begin{figure}[H]
\centering{\epsfile{file=figs/ResearchOrganization.eps,width=0.7\columnwidth}}
\caption{RTM$B8&5fAH?%(B}
\label{fig:ResaerchOrganization}
\end{figure}

RTM$B$NI8=`2=:n6H$K8~$1$?8&5f3+H/$K$*$$$F$O!"MM!9$J%a!<%+!<!"%3%s%]!<%M%s%H%Y%s%@!"8&5f<T$,3+H/$7$?%3%s%]!<%M%s%H$,Aj8_@\B3$G$-$k$h$&!"%$%s%?!<%U%'!<%9%l%Y%k$G$NI8=`2=$,?J$a$i$l$^$7$?!#(B
$BF10l$N%$%s%?!<%U%'!<%9$r;}$D%3%s%]!<%M%s%H$G$"$l$P!"<BAu$NG!2?$K4X$o$i$:MM!9$J%3%s%]!<%M%s%H$,F10l%7%9%F%`$K$*$$$F6(D4$G$-$k$3$H$rL\;X$7$F$$$^$9!#(B

$B$3$NI8=`;EMM;vBV$O%*!<%W%s$J$b$N$G$"$j!"$3$N;EMM$K4p$E$$$FC/$G$b$3$N<BAu$r:n@.$9$k$3$H$,=PMh$^$9!#(B
$B<BAu$5$l$?$b$N$O!":n@.<T$,G$0U$N%i%$%;%s%9$K4p$E$$$FG[I[!&HNGd$9$k$3$H$,=PMh$^$9!#(B
OpenRTM\--aist $B$OFHN)9T@/K!?M;:6H5;=QAm9g8&5f=j$,%U%j!<$GDs6!$9$k(B RTM Specification $B$K4p$E$$$?<BAu$N$R$H$D$K$"$?$j$^$9(B ($B?^(B~\ref{fig:RTM_Standardization})$B!#(B
$B8=:_$N$H$3$m!"$3$N(BRTM$B%$%s%?!<%U%'!<%9;EMM$K=`5r$7$?(BRTM$B<BAu$G%U%j!<$J$b$N$O(B OpenRTM\--aist $B$7$+$"$j$^$;$s!#(B
RTM Specification $B$O%3%s%]!<%M%s%H$N4pK\E*$J%$%s%?!<%U%'!<%9!"$9$J$o$A%3%s%]!<%M%s%H%*%V%8%'%/%H!"(BInport/Outport$B%*%V%8%'%/%H$K$D$$$F$N4pK\E*$J%$%s%?!<%U%'!<%9$r5,Dj$7$F$$$k$K2a$.$^$;$s!#(B
OpenRTM\--aist $B$G$OI8=`%$%s%?!<%U%'!<%9;EMM$K=`5r$7$?%3%s%]!<%M%s%H$H$H$b$K!"$3$l$rMF0W$K3+H/$9$k$?$a$N%U%l!<%`%o!<%/!"3F<o%5!<%S%972$r$$$C$?$$$H$7$FG[I[$7$F$$$^$9!#(B

\begin{figure}[H]
\vspace{5mm}
\centering{\epsfile{file=figs/RTM_Standardization.eps,width=0.7\columnwidth}}
\caption{RTM Specification $B$H(B OpenRTM\--aist $B$N4X78(B}
\label{fig:RTM_Standardization}
\end{figure}

InPort/OutPort$B$N%G!<%?7?!"%^%M!<%8%c$J$I!"%3%s%]!<%M%s%H1?MQ>eI,MW$G$"$k$,!"$=$N%"%W%j%1!<%7%g%s$K$h$j$^$?<BAu<T$K$h$jMM!9$J7ABV$,9M$($i$l!"$+$D%3%s%]!<%M%s%H$NAj8_@\B3@-$K4XM?$7$J$$ItJ,$K$D$$$F$O4pK\;E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r:n@.$9$k!#(B 
\item PIM$B$r4p$K!"(BOS$B$d8@8l!"%_%I%k%&%'%"$J$I$KFC2=$7$?%b%G%k!V(BPSM (Platform Specific Model)$B!W$r:n@.$9$k!#(B
\item PSM$B$r4p$K!"%W%m%0%i%`$r@8@.$9$k(B
\end{enumerate}
$B$H$$$&N.$l$G3+H/$,?J$a$i$l$k$H$$$&$3$H$K$J$C$F$$$^$9!#(B

\subsection{PIM (Platform Independent Model)}
PIM $B$H$O%W%i%C%H%U%)!<%`$K0MB8$7$J$$%b%G%k$G$"$j!"$3$3$G$N%W%i%C%H%U%)!<%`$H$O(BOS$B$d8@8l!"%_%I%k%&%'%"$J$I$r;X$7$^$9!#(B
RTM $B%W%m%8%'%/%H$K$*$$$F:vDj$5$l$?;EMM$O(BCORBA$B$rA0Ds$H$7$?(BIDL$B%U%!%$%k$H<~JU$N;EMM$H$7$FDs6!$5$l$F$$$^$9!#(B
$B$7$?$,$C$F!"(BRTM$B;EMM$O%W%i%C%H%U%)!<%`$K0MB8$9$k$H$$$&0UL#$G(B PIM $B$H$O$J$C$F$$$^$;$s!#(B
$B$7$+$7$J$,$i!"%$%s%?!<%U%'!<%9@_7W$K4X$o$k9M$(J}$r(B PIM $B$K0lHL2=$9$k$3$H$O2DG=$G$9$N$G!">-MhE*$K$O(B PIM $B%l%Y%k$GI8=`2=$,9T$o$l$k2DG=@-$b$"$j$^$9!#(B
PIM $B%l%Y%k$G$NI8=`2=$,9T$o$l$l$P!"B>$N%W%i%C%H%U%)!<%`(B (JEB, DCOM, SOAP, XML-RPC) $B$J$I$X$N%]!<%F%#%s%0$b2DG=$K$J$k$G$7$g$&(B($B?^(B~\ref{fig:RTM_Standardization})$B!#(B

\subsection{PSM (Platform Specific Model)}
PSM $B$H$O%W%i%C%H%U%)!<%`$K0MB8$7$?%b%G%k$G$"$j!"Nc$($P(B CORBA $B$r%W%i%C%H%U%)!<%`$H5,Dj$7$?>l9g(B IDL $B%$%s%?!<%U%'!<%9%l%Y%k$G$N%b%G%k2=$K$J$j$^$9!#(B
RTM $B$G$O!";EMM$r(B CORBA $B$N(B IDL $B%l%Y%k$G$N%$%s%?!<%U%'!<%9$NE}0l2=$K$h$kI8=`2=$r9T$C$F$-$F$*$j!"8=:_F@$i$l$F$$$k;EMM$O(BPSM$B$G$"$k$H$$$($^$9(B($B?^(B~\ref{fig:RTM_Standardization})$B!#(B

\newpage
\section{RTM Specification Ver.0.1}

\subsection{RTMBase.idl}
\verb|RTMBase.idl| $B$G$OA4BN$K6&DL$9$k;(B?$JDj5A$r9T$C$F$$$^$9!#(B

\begin{src}{RTMBase.idl}\footnotesize
\begin{verbatim}
module RTM {

  typedef short RtmRes;

  const RtmRes RTM_OK        = 0;
  const RtmRes RTM_ERR       = 1;
  const RtmRes RTM_WARNING   = 2;
  const RtmRes RTM_FATAL_ERR = 4;

  struct NamedValue {
    string name;
    any value;
  };

  typedef sequence<NamedValue> NVList;

  struct Time
  {
    unsigned long sec;    // sec
    unsigned long nsec;   // nano sec
  };
};
\end{verbatim}
\end{src}

RTM$B$N%*%Z%l!<%7%g%s$NLa$jCM$H$7$F(B \verb|RtmRes| $B$rDj5A$7$F$$$^$9!#(B
$B%*%Z%l!<%7%g%s$,@5>o$K<B9T$5$l$?$+$I$&$+$rLa$jCM$H$7$FJV$9>l9g!"(B\verb|RtmRes| $B$rLa$jCM$H$7$F!"0J2<$NCM$rDj5A$7$F$$$^$9!#(B

\begin{tab}{$B!|(B $B%*%Z%l!<%7%g%s$NLa$jCM(B}
\begin{tabular}{ll}
\verb|const RtmRes RTM_OK        = 0;| & $B@5>o=*N;(B\\
\verb|const RtmRes RTM_ERR       = 1;| & $B%(%i!<=*N;(B\\
\verb|const RtmRes RTM_WARNING   = 2;| & $B7Y9p(B\\
\verb|const RtmRes RTM_FATAL_ERR = 4;| & $BCWL?E*%(%i!<=*N;(B\\
\end{tabular}
\end{tab}

$BG$0U$N7?$NCM$r3JG<$9$k9=B$BN$H$7$F!"(B\verb|NamedValue| $B$rDj5A$7$F$$$^$9!#(B
$B$^$?!"(B\verb|NamedValue| $B$N%7!<%1%s%97?$H$7$F(B \verb|NVList| $B$rDj5A$7$F$$$^$9!#(B

$B;~4V$r3JG<$9$k9=B$BN$H$7$F(B \verb|Time| $B9=B$BN$rDj5A$7$F$$$^$9!#(B
Time$B9=B$BN$O(B $BICC10L$N(B \verb|sec| $B5Z$S%J%NICC10L$N(B \verb|nsec| $B$N%a%s%P$+$i9=@.$5$l$^$9!#(B
$B<g$K!"(BInPort/OutPort$B$G$d$j<h$j$5$l$k%G!<%?$N%?%$%`%9%?%s%W$K;HMQ$5$l$^$9!#(B

\newpage
\subsection{RTComponent}
$B0J2<$K(BRTComponent$B$N%$%s%?!<%U%'!<%9(BIDL$B$r<($7$^$9!#(B

\begin{src}{RTComponent.idl (1)}\footnotesize
\begin{verbatim}
#include "RTMBase.idl"
#include "RTCInPort.idl"
#include "RTCOutPort.idl"

module RTM {
  interface RTComponent
  //    : NamedObject, PropertySet
  {
    readonly attribute string instance_id;
    readonly attribute string implementation_id;
    readonly attribute string description;
    readonly attribute string version;
    readonly attribute string maker;
    readonly attribute string category;

    typedef short ComponentState;

    const ComponentState RTC_UNKNOWN        = 0;
    const ComponentState RTC_BORN           = 1;
    const ComponentState RTC_INITIALIZING   = 2;
    const ComponentState RTC_READY          = 3;
    const ComponentState RTC_STARTING       = 4;
    const ComponentState RTC_ACTIVE         = 5;
    const ComponentState RTC_STOPPING       = 6;
    const ComponentState RTC_ABORTING       = 7;
    const ComponentState RTC_ERROR          = 8;
    const ComponentState RTC_FATAL_ERROR    = 9;
    const ComponentState RTC_EXITING        = 10;

    exception IllegalTransition {};

\end{verbatim}
\end{src}

RT$B%3%s%]!<%M%s%H$NK\BN$H$J$k%*%V%8%'%/%H$N@k8@$G(B \verb|interface RTComponent| $B%$%s%?!<%U%'!<%9$H$7$FDj5A$5$l$F$$$^$9!#(B
RTM$B$N%$%s%?!<%U%'!<%9Dj5A$OA4$F(B \verb|RTM| $BL>A06u4V$N2<$GDj5A$5$l$^$9!#(B

\subsubsection*{$B%W%m%U%!%$%k$N(Battribute}
$B%3%s%]!<%M%s%H%W%m%U%!%$%k>pJs$N0J2<$N9`L\$r(B \verb|attribute| $B$H$7$FDj5A$7$F$$$^$9!#(B

\begin{tab}{$B!|(B $B%3%s%]!<%M%s%H$N%W%m%U%!%$%k>pJs(B}
\begin{tabular}{ll}
\verb|readonly attribute string instance_id;|       & $B%$%s%9%?%s%9(BID \\
\verb|readonly attribute string implementation_id;| & $B%$%s%W%j%a%s%F!<%7%g%s(BID\\
\verb|readonly attribute string description;|       & $B35MW@bL@(B\\
\verb|readonly attribute string version;|           & $B%P!<%8%g%s(B\\
\verb|readonly attribute string maker;|             & $B:n@.<T(B\\
\verb|readonly attribute string category;|          & $B%+%F%4%j(B\\
\end{tabular}
\end{tab}

\subsection{$B%3%s%]!<%M%s%H%"%/%F%#%S%F%#>uBV(B}
$B%3%s%]!<%M%s%H%"%/%F%#%S%F%#$N>uBV$H$7$F!"(BCORBA $B$N(B short $B7?JQ?t$H$7$F(B \verb|ComponentState| $B$r(B \verb|typedef| $B$7!"3F>uBV$rI=$9(B \verb|const| $BDj?t$H$7$F0J2<$N(B11$B$N>uBV$rDj5A$7$F$$$^$9!#(B

\begin{tab}{$B!|(B $B%3%s%]!<%M%s%H%"%/%F%#%S%F%#>uBV(B}
\begin{tabular}{ll}
\verb|const ComponentState RTC_UNKNOWN        = 0;| & UNKNOWN $B>uBV(B \\
\verb|const ComponentState RTC_BORN           = 1;| & BORN $B>uBV(B \\
\verb|const ComponentState RTC_INITIALIZING   = 2;| & INITIALIZING $B>uBV(B\\
\verb|const ComponentState RTC_READY          = 3;| & READY$B>uBV(B\\
\verb|const ComponentState RTC_STARTING       = 4;| & STARTING$B>uBV(B\\
\verb|const ComponentState RTC_ACTIVE         = 5;| & ACTIVE$B>uBV(B\\
\verb|const ComponentState RTC_STOPPING       = 6;| & STOPPING$B>uBV(B\\
\verb|const ComponentState RTC_ABORTING       = 7;| & ABORTING$B>uBV(B\\
\verb|const ComponentState RTC_ERROR          = 8;| & ERROR$B>uBV(B\\
\verb|const ComponentState RTC_FATAL_ERROR    = 9;| & FATAL\_ERROR$B>uBV(B\\
\verb|const ComponentState RTC_EXITING        = 10;| & EXITING$B>uBV(B
\end{tabular}
\end{tab}

$B>e5-$N>uBV$O?^(B~\ref{fig:RTC_StateTransition}$B$N>uBVA+0\$K=>$$$^$9!#(B

\begin{figure}[H]
\centering{\epsfile{file=figs/RT_RTComponentStateChart.eps,width=0.9\columnwidth}}
\caption{RT$B%3%s%]!<%M%s%H>uBVA+0\?^(B}
\label{fig:RTC_StateTransition}
\end{figure}

\newpage

\begin{src}{RTComponent.idl (2)}\footnotesize
\begin{verbatim}
    RtmRes rtc_worker();

    RtmRes rtc_start() raises (IllegalTransition);
    RtmRes rtc_stop() raises (IllegalTransition);
    RtmRes rtc_reset() raises (IllegalTransition);
    RtmRes rtc_exit() raises (IllegalTransition);
    RtmRes rtc_kill();

    readonly attribute OutPort rtc_state;

    exception NoSuchName { string name; };
    readonly attribute InPortList inports;
    InPort get_inport(in string name) raises (NoSuchName);
    readonly attribute OutPortList outports;
    OutPort get_outport(in string name) raises (NoSuchName);

    //! Return connector port object reference list
    //    readonly attribute ConnectorList connectors;
    //    OutPort get_connector(in string name) raises (NoSuchName);

    //    readonly attribute PropertySet rtc_settings;

  };

  typedef sequence<RTComponent> RTComponentList;
  
};  // end of module RTM
\end{verbatim}
\end{src}

\verb|rtc_worker()| $B%*%Z%l!<%7%g%s$O%3%s%]!<%M%s%H$N%"%/%F%#%S%F%#K\BN$,<B9T$5$l$k%*%Z%l!<%7%g%s$G$9!#(B
$BDL>o$O!"FbIt$+$i<B9T$5$l30It$+$i8F$S=P$5$l$k$3$H$O$"$j$^$;$s$,!"J#9g%3%s%]!<%M%s%H$r9=@.$9$k>l9g$J$I$K30It$NF14|$r<h$k%3%s%]!<%M%s%H$J$I$+$i8F$S=P$5$l$k$3$H$b$"$j$^$9!#(B

\verb|rtc_start()|-\verb|rtc_kill()| $B%*%Z%l!<%7%g%s$O%3%s%]!<%M%s%H$N>uBV$rA+0\$5$;$k$?$a$N%*%Z%l!<%7%g%s$H$7$FDj5A$5$l$F$$$^$9!#(B
$B%3%s%]!<%M%s%H%"%/%F%#%S%F%#$N>uBVA+0\$O?^(B~\ref{fig:RTC_StateTransition}$B$K$7$?$,$C$F9T$o$l$^$9!#(B

$B8F$S=P$5$l$k%*%Z%l!<%7%g%s$,8=:_$N>uBV$K$*$$$FE,@Z$G$J$+$C$?>l9g!"(B\verb|IllegalTransition| $B$,H/@8$7$^$9!#(B

\verb|rtc_state| $B$O%3%s%]!<%M%s%H$N>uBV$r=PNO$9$k(BOutPort$B%*%V%8%'%/%H$N%j%U%!%l%s%9$rJV$7$^$9!#(B
$B$3$N(BOutPort$B$rMQ$$$F%3%s%]!<%M%s%H$N>uBV$r(Bpull$B7?$^$?$O(Bpush$B7?%G!<%?E>Aw$G<hF@$9$k$3$H$,=PMh$^$9!#(B

\begin{tab}{$B!|(B $B%3%s%]!<%M%s%H%"%/%F%#%S%F%#$H>uBVA+0\%*%Z%l!<%7%g%s(B}
\begin{tabular}{lp{45mm}}
\verb|RtmRes rtc_worker();| & $B%"%/%F%#%S%F%#K\BN(B\\
&\\
\verb|RtmRes rtc_start() raises (IllegalTransition);| & ACTIVE $B>uBV$XA+0\(B\\
\verb|RtmRes rtc_stop() raises (IllegalTransition);| & READY $B>uBV$XA+0\(B\\
\verb|RtmRes rtc_reset() raises (IllegalTransition);| & INITIALIZING$B>uBV$XA+0\(B\\
\verb|RtmRes rtc_exit() raises (IllegalTransition);| & EXITING$B>uBV$XA+0\(B\\
\verb|RtmRes rtc_kill();| & FATAL\_ERROR $B>uBV$N$H$-(BEXITING$B>uBV$XA+0\(B\\
\verb|readonly attribute OutPort rtc_state;| & $B%3%s%]!<%M%s%H>uBV(BOutPort \\
\end{tabular}
\end{tab}


$B%3%s%]!<%M%s%H$O(B1$B$D0J>e$N%G!<%?F~=PNO%*%V%8%'%/%H(B InPort/OutPort $B$r;}$D$3$H$,=PMh$^$9!#(B
$B0J2<$N%*%Z%l!<%7%g%s$r;HMQ$7$3$l$i$N%*%V%8%'%/%H%j%U%!%l%s%9$r<hF@$9$k$3$H$,=PMh$^$9!#(B

\begin{tab}{$B!|(B InPort/OutPort}
\begin{tabular}{lp{60mm}}
\verb|exception NoSuchName { string name;};| & $BNc30Dj5A(B \\
\verb|readonly attribute InPortList inports;| & InPortList $B$r<hF@(B \\
\verb|InPort get_inport(in string name)| & $BL>A0$r;XDj$7(BInPort$B$r<hF@(B\\
\verb|             raises (NoSuchName);| & \\
\verb|readonly attribute OutPortList outports;| & OutPortList$B$r<hF@(B\\
\verb|OutPort get_outport(in string name)| & $BL>A0$r;XDj$7(BOutPort$B$r<hF@(B\\
\verb|             raises (NoSuchName);| & \\
\end{tabular}
\end{tab}

$B:G8e$K!"%3%s%]!<%M%s%H$N%*%V%8%'%/%H%j%U%!%l%s%9$r%7!<%1%s%9$H$7$FJ]B8$9$k(B \verb|RTComponentList| $B$rDj5A$7$F$$$^$9!#(B
$BJ#?t$N%3%s%]!<%M%s%H$r$^$H$a$F07$&>l9g$K;HMQ$7$^$9!#(B


\newpage
\subsection{RTCInPort.idl}
\begin{src}{RTCInPort.idl}\footnotesize
\begin{verbatim}
#include "RTMBase.idl"

module RTM {
  typedef string SubscriptionID;

  struct PortProfile
  {
    string name;
    CORBA::TypeCode port_type;
    NVList properties;
  };
  
  interface InPort
  {
    exception Disconnected{};

    void put(in any data) raises(Disconnected);

    readonly attribute PortProfile profile;
  };

  typedef sequence<InPort> InPortList;
  typedef sequence<PortProfile> PortProfileList;

}; // end of module RTM

\end{verbatim}
\end{src}

$B$^$:!"(BCORBA string $B7?$H$7$F(B \verb|SubscriptionID| $B$rDj5A$7$F$$$^$9!#(B
\verb|SubscriptionID| $B$O(BOutPort$B$r%5%V%9%/%i%$%V$9$k:]$N<1JL(BID$B$G!"DL>o$O(BUUID$B$r;HMQ$7$^$9!#(B

$B9=B$BN(B \verb|PortProfile| $B$O(B InPort/OutPort $B$N%W%m%U%!%$%k>pJs$r3JG<$9$k9=B$BN$G$9!#%H%C%W%l%Y%k$K$O!"%]!<%HL>(B: \verb|name|$B$H%]!<%H7?(B: \verb|port_type| $B$N$_$r$b$A!"$=$NB>$N>pJs$O(B \verb|NamedValue| $B$N%7!<%1%s%9(B: \verb|NVList| $B$H$7$FJ];}$7$^$9!#(B

InPort$B$N%$%s%?!<%U%'!<%9@k8@$G$O!"(BInPort$B$K%G!<%?$rAw$k(B\verb|put()|$B%$%s%?!<%U%'!<%9$,$"$j!"$3$l$K$h$j(BInPort$B$K%G!<%?$rEO$9$3$H$,=PMh$^$9!#(B
$B$9$G$K!"@\B3$,@ZCG$5$l$F$$$k(BOutPort$B$+$i(Bput$B$r8F$S=P$9$H(B \verb|Disconnected| $BNc30$,H/@8$7$^$9!#(B
InPort$B$N%W%m%U%!%$%k%G!<%?$O%a%s%P$N(B \verb|profile| $B$K3JG<$5$l$F$$$^$9!#(B

\newpage
\subsection{RTCOutPort.idl}
\begin{src}{RTCOutPort.idl}\footnotesize
\begin{verbatim}
#include "RTMBase.idl"
#include "RTCInPort.idl"

module RTM {
  typedef short SubscriptionType;
  
  const SubscriptionType OPS_ONCE                = 0;
  const SubscriptionType OPS_PERIODIC            = 1;
  const SubscriptionType OPS_NEW                 = 2;
  const SubscriptionType OPS_TRIGGERED           = 3;
  const SubscriptionType OSP_PERIODIC_NEW        = 4;
  const SubscriptionType OPS_NEW_PERIODIC        = 5;
  const SubscriptionType OPS_PERIODIC_TRIGGERED  = 6;
  const SubscriptionType OPS_TRIGGERRED_PERIODIC = 7;
  
  struct SubscriberProfile
  {
    SubscriptionType subscription_type;
    boolean event_base;
    NVList properties;
  };

  interface OutPort
  {
    any get();
    RtmRes subscribe(in InPort in_port, out SubscriptionID id,
                     in SubscriberProfile profile);
    RtmRes unsubscribe(in SubscriptionID id);
    readonly attribute InPortList inports;
    readonly attribute PortProfile profile;
  };

  typedef sequence<OutPort> OutPortList;
}; // end of module RTM

\end{verbatim}
\end{src}

$B$^$:$O$8$a$K!"(BOutPort$B$r%5%V%9%/%i%$%V$9$k:]$N%b!<%I(B \verb|SubscriptionType| $B$r(BCORBA short $B7?$G(B \verb|typedef| $B$7$F$$$^$9!#(B

$B%5%V%9%/%j%W%7%g%s7?Dj?t$O0J2<$N$h$&$KDj5A$5$l$F$$$^$9!#(B

\begin{src}{$B!|(B $B%5%V%9%/%j%W%7%g%s7?(B}
\begin{tabular}{ll}
\verb|OPS_ONCE                = 0;| & $B0lEY$@$1%G!<%?<hF@$9$k(B \\
\verb|OPS_PERIODIC            = 1;| & $B0lDj<~4|$G%G!<%?Aw?.(B\\
\verb|OPS_NEW                 = 2;| & $B%G!<%?99?7;~$K%G!<%?Aw?.(B\\
\verb|OPS_TRIGGERED           = 3;| & $B%H%j%,$K$h$j%G!<%?Aw?.(B\\
\verb|OSP_PERIODIC_NEW        = 4;| & $B0lDj<~4|$G%G!<%?99?7;~$N$_Aw?.(B\\
\verb|OPS_NEW_PERIODIC        = 5;| & $B%G!<%?99?7;~$KAw?.!&0lDj<~4|$GAw?.(B\\
\verb|OPS_PERIODIC_TRIGGERED  = 6;| & $B0lDj<~4|$G%H%j%,;~$N$_Aw?.(B\\
\verb|OPS_TRIGGERRED_PERIODIC = 7;| & $B%H%j%,;~$KAw?.!&0lDj<~4|$GAw?.(B\\
\end{tabular}
\end{src}

\verb|OPS_ONCE|$B$G$O%5%V%9%/%i%$%V8e0lEY$@$1%G!<%?$r<hF@$7$F@\B3$,@ZCG$5$l$^$9!#(B

\verb|OPS_PERIODIC| $B$O;XDj$7$?<~4|$G%G!<%?Aw?.$r%5%V%9%/%i%$%P$KAw?.$7$^$9!#(B

\verb|OPS_NEW| $B$O(BOutPort$B$N%G!<%?$,99?7$5$l<!Bh$9$0$K%5%V%9%/%i%$%P$K%G!<%?$,Aw?.$5$l$^$9!#(B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atim}
  struct SubscriberProfile
  {
    SubscriptionType subscription_type;
    boolean event_base;
    NVList properties;
  };
\end{verbatim}
\end{src}
\verb|SubscriptionType subscription_type|$B$K>e5-$N(B \verb|SubscriptionType| $B$r;XDj$7$^$9!#(B
$B%5%V%9%/%j%W%7%g%s$,%$%Y%s%H$K0MB8$9$k$+H]$+$r(B CORBA Boolean $B7?$G(B \verb|event_base| $B$K;XDj$7$^$9!#(B
$B%5%V%9%/%j%W%7%g%s$K4X$9$k$=$NB>$N%W%m%Q%F%#$O(B \verb|NVList properties| $B$K;XDj$7$^$9!#(B

OutPort$B$r%5%V%9%/%i%$%V$9$k>l9g$K$O!"$3$N9=B$BN$KE,@Z$J%G!<%?$r%;%C%H$7$F!"(BOutPort$B$N(B\verb|subscribe()| $B%*%Z%l!<%7%g%s$r8F$S=P$5$J$1$l$P$J$j$^$;$s!#(B

$B<!$K(B OutPort $B%$%s%?!<%U%'!<%9$G$9!#(B

\begin{src}{}
\begin{verbatim}
  interface OutPort
  {
    any get();
    RtmRes subscribe(in InPort in_port, out SubscriptionID id,
                     in SubscriberProfile profile);
    RtmRes unsubscribe(in SubscriptionID id);
    readonly attribute InPortList inports;
    readonly attribute PortProfile profile;
  };

  typedef sequence<OutPort> OutPortList;
\end{verbatim}
\end{src}

\verb|get()| $B%*%Z%l!<%7%g%s$G$O!"8=:_$N(BOutPort$B$NCM$r(BAny$B7?$G<hF@$9$k$3$H$,=PMh$^$9!#(B

$BDj4|E*$K%G!<%?$r(Bpush$B7?$GAw$C$F$[$7$$>l9g$K$O(B \verb|subscribe()| $B%*%Z%l!<%7%g%s$G%5%V%9%/%i%$%V$7$^$9!#(B
$B0z?t$K$O!"%5%V%9%/%i%$%V$9$k(BInPort$B$N%*%V%8%'%/%H%j%U%!%l%s%9$H!"%5%V%9%/%i%$%P$N%W%m%U%!%$%k9=B$BN$r;XDj$7$^$9!#(B
\verb|subscribe()| $B$,@.8y$9$k$H(B \verb|RtmRes| $B$K(B \verb|RTM_OK| $B$,La$jCM$H$7$FJV$j!"(B\verb|SubscriptionID id| $B$K(B UUID (Universally Unique IDentifier) $B$rJV$7$^$9!#(B

$B%5%V%9%/%i%$%V$r$d$a$k$H$-$K$O$3$N(BUUID$B$r;XDj$7$F(B\verb|unsubscribe()|$B%*%Z%l!<%7%g%s$rH/9T$7$^$9!#(B

OutPort $B$O%5%V%9%/%i%$%V$7$F$$$k(BInPort$B$N%j%9%H(B \verb|InPortList inports| $B$r(B \verb|attribute| $B$H$7$FJ];}$7$F$$$^$9!#(B
$B$^$?!"(BOutPort$B<+?H$N%W%m%U%!%$%k$H$7$F(B \verb|PortProfile profile| $B$r(B \verb|attribute| $B$H$7$FJ];}$7$F$$$^$9!#(B


\newpage
\section{OpenRTM\--aist $B%$%s%?!<%U%'!<%9Dj5A(B}
OpenRTM\--aist $B$G$O!"(BRTM Specification $B$K4p$E$-!"$$$/$D$+$N%$%s%?!<%U%'!<%9$N3HD%$H!"?7$?$J%*%V%8%'%/%H%$%s%?!<%U%'!<%9$NDj5A$rDI2C$7$F$$$^$9!#(B

\begin{tab}{$B!|(B OpenRTM\--aist $B%$%s%?!<%U%'!<%9Dj5A(BIDL$B%U%!%$%k(B}
\begin{tabular}{ll}
\verb|RTCBase.idl| & RTComponent $B$r3HD%$9$k%$%s%?!<%U%'!<%9$rDj5A(B\\
\verb|RTCProfile.idl| & RTComponent$B$,;}$D%W%m%U%!%$%k$r3HD%$79=B$BN$H$7$FDj5A(B\\
\verb|RTCDataType.idl| & InPort/OutPort$B$N$?$a$NI8=`E*$J%G!<%?%?%$%W$rDj5A(B\\
\verb|RTCMnager.idl| & RTComponent $B$N%i%$%U%5%$%/%k$r4IM}$9$k%^%M!<%8%c(B\\
\end{tabular}
\end{tab}

\subsection{RTCBase.idl}
OpenRTM\--aist $B$G$O(B RTComponent $B%$%s%?!<%U%'!<%9$r3HD%$7$?%$%s%?!<%U%'!<%9Dj5A(B \verb|RTCBase| $B$rDs6!$7$^$9!#(B
$B3HD%%$%s%?!<%U%'!<%9$O<g$K!"J#9g%3%s%]!<%M%s%H$r9=@.$9$k$?$a$KI,MW$J%$%s%?!<%U%'!<%9$rDj5A$7$F$$$^$9!#(B

\begin{src}{RTCBase.idl}\footnotesize
\begin{verbatim}
#include "RTComponent.idl"
#include "RTCProfile.idl"

module RTM {
  
  interface RTCBase;
  typedef sequence<RTCBase> RTCBaseList;

  interface RTCBase
    : RTComponent
  {
    RtmRes rtc_ready_entry();
    RtmRes rtc_ready_do();
    RtmRes rtc_ready_exit();
    RtmRes rtc_active_entry();
    RtmRes rtc_active_do();
    RtmRes rtc_active_exit();
    RtmRes rtc_error_entry();
    RtmRes rtc_error_do();
    RtmRes rtc_error_exit();
    RtmRes rtc_fatal_entry();
    RtmRes rtc_fatal_do();
    RtmRes rtc_fatal_exit();
    RtmRes rtc_init_entry();
    RtmRes rtc_starting_entry();
    RtmRes rtc_stopping_entry();
    RtmRes rtc_aborting_entry();
    RtmRes rtc_exiting_entry();

    RtmRes rtc_stop_thread();
    RtmRes rtc_start_thread();

    RtmRes rtc_set_parent(in RTCBase comp);
    RtmRes rtc_add_component(in RTCBase comp);
    RtmRes rtc_delete_component(in RTCBase comp);
    RtmRes rtc_replace_component(in RTCBase comp1, in RTCBase comp2);
    RtmRes rtc_replace_component_by_name(in string name1, in string name2);
    RTCBaseList rtc_components();
    RTCBase rtc_get_component(in string name);

    RtmRes rtc_attach_inport(in InPort in_port);
    RtmRes rtc_attach_inport_by_name(in RTCBase comp, in string name);
    RtmRes rtc_detatch_inport(in InPort in_port);
    RtmRes rtc_detatch_inport_by_name(in string name);

    RtmRes rtc_attach_outport(in OutPort out_port);
    RtmRes rtc_attach_outport_by_name(in RTCBase comp, in string name);
    RtmRes rtc_detatch_outport(in OutPort out_port);
    RtmRes rtc_detatch_outport_by_name(in string name);

    readonly attribute RTCProfile profile;
  };
};
\end{verbatim}
\end{src}

$B%3%s%]!<%M%s%H%"%/%F%#%S%F%#$N3F>uBV$KBP1~$9$k%a%=%C%I$r!"(BCORBA$B%*%Z%l!<%7%g%s$H$7$FDj5A$7$F$$$^$9!#(B

\begin{src}{$B%"%/%F%#%S%F%#%*%Z%l!<%7%g%s(B}
\begin{verbatim}
    RtmRes rtc_ready_entry();
    RtmRes rtc_ready_do();
    RtmRes rtc_ready_exit();
    RtmRes rtc_active_entry();
    RtmRes rtc_active_do();
    RtmRes rtc_active_exit();
    RtmRes rtc_error_entry();
    RtmRes rtc_error_do();
    RtmRes rtc_error_exit();
    RtmRes rtc_fatal_entry();
    RtmRes rtc_fatal_do();
    RtmRes rtc_fatal_exit();
    RtmRes rtc_init_entry();
    RtmRes rtc_starting_entry();
    RtmRes rtc_stopping_entry();
    RtmRes rtc_aborting_entry();
    RtmRes rtc_exiting_entry();
\end{verbatim}
\end{src}

$B$3$l$i$N%*%Z%l!<%7%g%s$rDj5A$9$k$3$H$K$h$j!"%"%/%F%#%S%F%#$r<B9T$9$k<gBN(B($B%9%l%C%I(B)$B$r%3%s%]!<%M%s%H$N30It$KCV$/$3$H$,=PMh$k$h$&$K$J$j$^$9!#(B
$B$3$l$O!"J#?t$N%3%s%]!<%M%s%H$r%0%k!<%W2=$7%"%/%F%#%S%F%#$rF14|E*$+$D%7!<%1%s%7%c%k$K<B9T$9$kF14|J#9g%3%s%]!<%M%s%H$K$*$$$F;HMQ$9$k$3$H$rL\E*$H$7$F$$$^$9!#(B

\begin{src}{$B%"%/%F%#%S%F%#%*%9%l%C%I@)8f%Z%l!<%7%g%s(B}
\begin{verbatim}
    RtmRes rtc_stop_thread();
    RtmRes rtc_start_thread();
\end{verbatim}
\end{src}

$B$3$l$i$N%*%Z%l!<%7%g%s$K$h$j%3%s%]!<%M%s%HFbIt$N%"%/%F%#%S%F%#$r<B9T$9$k%9%l%C%I$N<B9T$r@)8f$9$k$3$H$,=PMh$^$9!#(B
$BJ#9g%3%s%]!<%M%s%H$K$*$$$F$O!"%"%/%F%#%S%F%#<B9T$N<gBN$G$"$k%9%l%C%I$r30It$KCV$/$?$a!"%3%s%]!<%M%s%HFbIt$N%9%l%C%I$rDd;_$5$;$J$1$l$P$J$j$^$;$s!#(B
$B$7$?$,$C$F!"30It$+$i%3%s%]!<%M%s%H%"%/%F%#%S%F%#%9%l%C%I$r@)8f$9$kI,MW@-$+$i!"$3$l$i$N%$%s%?!<%U%'!<%9$,Dj5A$5$l$F$$$^$9!#(B

\begin{src}{$B%3%s%]!<%M%s%H$N?F;R4X78$r@)8f$9$k%*%Z%l!<%7%g%s(B}
\begin{verbatim}
    RtmRes rtc_set_parent(in RTCBase comp);
    RtmRes rtc_add_component(in RTCBase comp);
    RtmRes rtc_delete_component(in RTCBase comp);
    RtmRes rtc_replace_component(in RTCBase comp1, in RTCBase comp2);
    RtmRes rtc_replace_component_by_name(in string name1, in string name2);
    RTCBaseList rtc_components();
    RTCBase rtc_get_component(in string name);
\end{verbatim}
\end{src}

$B$3$l$i$N%*%Z%l!<%7%g%s$O%3%s%]!<%M%s%H$N?F;R4X78$r@)8f$9$k$?$a$N%3%s%]!<%M%s%H$G$9!#(B
$BDL>o$NC1BN$N%3%s%]!<%M%s%H$G$O!"(B\verb|rtc_set_parent()| $B%*%Z%l!<%7%g%s$OL58z$K$J$j(B \verb|RTM_ERR| $B$rJV$7$^$9!#(B
$BJ#9g%3%s%]!<%M%s%H$G$O!"$3$l$i$N%*%Z%l!<%7%g%s$r;HMQ$7J#?t$N%3%s%]!<%M%s%H$r;R6!$H$7$F=jM-$9$k$3$H$,=PMh$^$9!#(B

\begin{src}{InPort$B%"%?%C%A%*%Z%l!<%7%g%s(B}
\begin{verbatim}
    RtmRes rtc_attach_inport(in InPort in_port);
    RtmRes rtc_attach_inport_by_name(in RTCBase comp, in string name);
    RtmRes rtc_detatch_inport(in InPort in_port);
    RtmRes rtc_detatch_inport_by_name(in string name);
\end{verbatim}
\end{src}

$B$3$l$i$N%*%Z%l!<%7%g%s$r;HMQ$9$k$3$H$K$h$jJ#9g%3%s%]!<%M%s%H$,=jM-$9$k;R%3%s%]!<%M%s%H$N(BInPort$B$r?F$G$"$kJ#9g%3%s%]!<%M%s%H$N(BInPort$B$H$7$F:FDj5A$G$-$k$h$&$K$J$j$^$9!#(B
$B<B:]$K$O!"?F%3%s%]!<%M%s%H$G;R%3%s%]!<%M%s%H$N(BInPort$B$N%*%V%8%'%/%H%j%U%!%l%s%9$rJ];}$7$F$$$k$@$1$G$9!#(B

\begin{src}{OutPort$B%"%?%C%A%*%Z%l!<%7%g%s(B}
\begin{verbatim}
    RtmRes rtc_attach_outport(in OutPort out_port);
    RtmRes rtc_attach_outport_by_name(in RTCBase comp, in string name);
    RtmRes rtc_detatch_outport(in OutPort out_port);
    RtmRes rtc_detatch_outport_by_name(in string name);
\end{verbatim}
\end{src}

$B$3$l$i$N%*%Z%l!<%7%g%s$r;HMQ$9$k$3$H$K$h$jJ#9g%3%s%]!<%M%s%H$,=jM-$9$k;R%3%s%]!<%M%s%H$N(BOutPort$B$r?F$G$"$kJ#9g%3%s%]!<%M%s%H$N(BOutPort$B$H$7$F:FDj5A$G$-$k$h$&$K$J$j$^$9!#(B
$B<B:]$K$O!"?F%3%s%]!<%M%s%H$G;R%3%s%]!<%M%s%H$N(BOutPort$B$N%*%V%8%'%/%H%j%U%!%l%s%9$rJ];}$7$F$$$k$@$1$G$9!#(B

\newpage
\subsection{RTCProfile.idl}
\verb|RTCProfile.idl| $B$G$O!!(BRTCProfile $B%$%s%?!<%U%'!<%9$rDj5A$7$F$$$^$9!#(B
\verb|RTCProfile| $B$O!!(B\verb|RTComponent| $B$N(B \verb|instance_id, implementation_id| $BEy$N%W%m%U%!%$%kDj5A$r3HD%$7!"9=B$$K$7$?$b$N$G$9!#(B
\verb|RTCBase| $B$G$O$3$N%W%m%U%!%$%k$r<hF@$9$k%*%Z%l!<%7%g%s$,3HD%$5$l!"%W%m%U%!%$%kA4BN$r(B1$BEY$K<hF@$G$-$k$h$&$K$J$C$F$$$^$9!#(B

\begin{src}{RTCProfile.idl}\footnotesize
\begin{verbatim}
module RTM {
  interface RTComponent;

  enum RTComponentType {
    STATIC,
    UNIQUE,
    COMMUTATIVE
  };

  enum RTCActivityType {
    PERIODIC,
    SPORADIC,
    EVENT_DRIVEN
  };

  enum RTCLangType {
    COMPILE,
    SCRIPT
  };

  struct RTCProfile
  {
    string name;
    string instance_id;
    string implementation_id;
    string description;
    string version;
    string maker;
    string category;
    RTComponentType component_type;
    RTCActivityType activity_type;
    long max_instance;
    string language;
    RTCLangType language_type;
    string module_profile_file;
    PortProfileList outport_profile_list;
    PortProfileList inport_profile_list;
  };
};
\end{verbatim}
\end{src}

$B0J2<$N(B \verb|instance_id, implementation_id| $BEy$K$D$$$F$O(B \verb|RTComponent.idl| $B$GDj5A$5$l$F$$$k$b$N$HA4$/F1$8$G$9!#(B

\begin{tab}{$B!|(B $B4pK\E*$J%W%m%U%!%$%k(B}
\begin{verbatim}
    string instance_id;
    string implementation_id;
    string description;
    string version;
    string maker;
    string category;
\end{verbatim}
\end{tab}

\verb|RTComponentType| $B$O%3%s%]!<%M%s%H$N%?%$%W$r;XDj$7$^$9!#(B
$B%3%s%]!<%M%s%H%?%$%W$H$O!"@8@.$5$l$k%3%s%]!<%M%s%H$N%$%s%9%?%s%9$N7A<0$r;X$7$^$9!#(B
$B%3%s%]!<%M%s%H%?%$%W$K$O0J2<$N$b$N$,$"$j$^$9!#(B

\begin{tab}{$B!|(B {\tt RTComponentType}}
\begin{tabular}{lp{95mm}}
STATIC & $B%3%s%]!<%M%s%H$O%^%M!<%8%c$KEPO?$5$l$k$HF1;~$K%$%s%9%?%s%92=$5$l!"?7$?$K@8@.$9$k$3$H$O$G$-$J$$!#%O!<%I%&%(%"$KL)@\$K4X78$9$k%3%s%]!<%M%s%HEy$O$3$N%?%$%W$K$9$k$H%O!<%I%&%(%"$H%3%s%]!<%M%s%H$NBP1~$,$H$j$d$9$$!#(B\\
UNIQUE & $B%3%s%]!<%M%s%H$OF0E*$K@8@.!&:o=|$9$k$,$G$-$k$,!"(Bcomponent0 $B$H(B component1 $B$O0[$J$kFbIt>uBV$r;}$A8r492DG=$G$O$J$$!#(B\\
COMMUTATIVE & $B%3%s%]!<%M%s%H$O!"8_$$$K8r492DG=!#%=%U%H%&%(%"$N%m%8%C%/$N$_$N%3%s%]!<%M%s%H$O$3$N%?%$%W$K$J$k!#(B
\end{tabular}
\end{tab}


\verb|RTCActivityType| $B$O%3%s%]!<%M%s%H$N%"%/%F%#%S%F%#$N%?%$%W$r;XDj$7$^$9!#(B
$B%3%s%]!<%M%s%H$N%"%/%F%#%S%F%#%?%$%W$O0J2<$N%?%$%W$,$"$j$^$9!#(B

\begin{tab}{$B!|(B {\tt RTCActivityType}}
\begin{tabular}{lp{95mm}}
PERIODIC & $B%3%s%]!<%M%s%H$N3hF0$O0lDj<~4|$G9T$o$l$^$9!#$?$@$7!"F0:n<~4|$r<i$l$k$+H]$+$O!"(BOS$B$K0MB8$7$^$9!#%j%"%k%?%$%`(BOS(ART-LINUX)$B$r;HMQ$9$l$P0lDj<~4|F0:n$r9T$o$;$k$3$H$O$G$-$^$9$,!"Hs%j%"%k%?%$%`(BOS$B$G$O87L)$J<~4|F0:n$r$5$;$k$3$H$OIT2DG=$G$9!#(B\\
SPORADIC & $B%3%s%]!<%M%s%H$N3hF0$N<~4|$O0lDj$G$O$J$$$,!"7+$jJV$79T$o$l$^$9!#(B\\
EVENT\_DRIVEN & $B30It$+$i$N%*%Z%l!<%7%g%s$K$h$j<uF0E*$KF0:n$7$^$9!#(B
\end{tabular}
\end{tab}

$B$=$NB>$N9`L\$K$D$$$F$O0J2<$N$H$*$j$G$9!#(B

\begin{tab}{$B!|(B $B$=$NB>(B}
\begin{tabular}{ll}
\verb|long max_instance;|          & $B:GBg$N%$%s%9%?%s%9?t!!(B\\
\verb|string language;|            & $B%3%s%]!<%M%s%H5-=R8@8l(B \\
\verb|RTCLangType language_type;|  & $B%3%s%]!<%M%s%H5-=R8@8l7?(B\\
\verb|string module_profile_file;| & $B%b%8%e!<%k%W%m%U%!%$%k%U%!%$%kL>(B\\
\end{tabular}
\end{tab}

$B$^$?!"(B\verb|RTCProfile| $B$O(BInPort/OutPort$B$N%W%m%U%!%$%k$b%j%9%H$H$7$FJ];}$7$F$$$^$9!#(B

\begin{tab}{$B!|(B InPort/OutPort$B%W%m%U%!%$%k%j%9%H(B}
\begin{tabular}{ll}
\verb|PortProfileList outport_profile_list;| & InPort $B%W%m%U%!%$%k$N%j%9%H(B\\
\verb|PortProfileList inport_profile_list;|  & OutPort $B%W%m%U%!%$%k$N%j%9%H(B\\
\end{tabular}
\end{tab}

\verb|PortProfileList| $B$O(B \verb|RTCInPort.idl| $B$GDj5A$5$l$F$$$k(B \verb|PortProfile| $B$N%7!<%1%s%9$G$9!#(B

\newpage
\subsection{RTCDataType.idl}
$B0J2<$K!"(B\verb|RTCDataType.idl| $B$r<($7$^$9!#(B

\begin{src}{RTCDataType.idl ($B4pK\7?(B)}\footnotesize
\begin{verbatim}
#include "RTMBase.idl"

module RTM {
  struct TimedState
  {
    Time tm;
    short data;
  };
 struct TimedShort
  {
    Time tm;
    short data;
  };
 struct TimedLong
  {
    Time tm;
    long data;
  };
  struct TimedUShort
  {
    Time tm;
    unsigned short data;
  };
  struct TimedULong
  {
    Time tm;
    unsigned long data;
  };
  struct TimedFloat
  {
    Time tm;
    float data;
  };
  struct TimedDouble
  {
    Time tm;
    double data;
  };
  struct TimedChar
  {
    Time tm;
    char data;
  };
  struct TimedBoolean
  {
    Time tm;
    boolean data;
  };
  struct TimedOctet
  {
    Time tm;
    octet data;
  };
  struct TimedString
  {
    Time tm;
    string data;
  };
\end{verbatim}
\end{src}

OpenRTM\--aist $B$G$O!"(BInPort/OutPort $B$G$d$j<h$j$9$k%G!<%?7?$H$7$F%?%$%`%9%?%s%WIU$-$N%G!<%?7?$r!"(BCORBA$B$N4pK\7?$H$=$N%7!<%1%s%97?$K$D$$$FDs6!$7$F$$$^$9!#(B

\begin{src}{RTCDataType.idl ($B%7!<%1%s%97?(B)}\footnotesize
\begin{verbatim}
  struct TimedShortSeq
  {
    Time tm;
    sequence<short> data;
  };
  struct TimedLongSeq
  {
    Time tm;
    sequence<long> data;
  };
  struct TimedUShortSeq
  {
    Time tm;
    sequence<unsigned short> data;
  };
  struct TimedULongSeq
  {
    Time tm;
    sequence<unsigned long> data;
  };
  struct TimedFloatSeq
  {
    Time tm;
    sequence<float> data;
  };
  struct TimedDoubleSeq
  {
    Time tm;
    sequence<double> data;
  };
  struct TimedCharSeq
  {
    Time tm;
    sequence<char> data;
  };
  struct TimedBooleanSeq
  {
    Time tm;
    sequence<boolean> data;
  };
  struct TimedOctetSeq
  {
    Time tm;
    sequence<octet> data;
  };
  struct TimedStringSeq
  {
    Time tm;
    sequence<string> data;
  };
};
\end{verbatim}
\end{src}

\newpage
\subsection{RTCManager.idl}

\verb|RTCManager| $B$O(B \verb|RTComponent| $B$N%b%8%e!<%k$N%m!<%I!"%$%s%9%?%s%92=Ey$N%i%$%U%5%$%/%k4IM}$r9T$&%*%V%8%'%/%H$G$9!#(B

\begin{src}{RTCProfile.idl}\footnotesize
\begin{verbatim}
#include "RTMBase.idl"
#include "RTComponent.idl"
#include "RTCBase.idl"

module RTM
{
  typedef sequence<string> ComponentFactoryList;
  
  interface RTCManager
  {
    RtmRes load(in string pathname, in string initfunc);
    RtmRes unload(in string pathname);
    RTCBase create_component(in string comp_name,
                             out string instance_name);
    RtmRes delete_component(in string instance_name);
    ComponentFactoryList component_factory_list();
    RTCBaseList component_list();
    RtmRes command(in string cmd, out string ret);
  };

} // end of namespace RTM
\end{verbatim}
\end{src}

$B%@%$%J%_%C%/$K%b%8%e!<%k$r%m!<%I!&%"%s%m!<%I$9$k$?$a$N!"(B\verb|load(), unload()|
 $B%*%Z%l!<%7%g%s$,Dj5A$5$l$F$$$^$9!#(B


\begin{tab}{$B!|(B $B%b%8%e!<%k$N%m!<%I!&%"%s%m!<%I%*%Z%l!<%7%g%s(B}
\begin{tabular}{ll}
\verb|load(in string pathname, in string initfunc);| & $B%b%8%e!<%k$N%m!<%I(B\\
\verb|unload(in string pathname);|  & $B%b%8%e!<%k$N%"%s%m!<%I(B\\
\end{tabular}
\end{tab}

$B$^$?!"(B\verb|create_component(), delete_component()| $B$O%3%s%]!<%M%s%H$N@8@.!&:o=|$r9T$&%*%Z%l!<%7%g%s$G$9!#(B

\begin{tab}{$B!|(B $B%3%s%]!<%M%s%H$N@8@.!&:o=|$r9T$&%*%Z%l!<%7%g%s(B}
\begin{tabular}{ll}
\verb|create_component(in string comp_name,| & $B%3%s%]!<%M%s%H$N@8@.(B\\
\verb|                  out string instance_name);| & \\
\verb|delete_component(in string instance_name);|   & $B%3%s%]!<%M%s%H$N:o=|(B\\
\end{tabular}
\end{tab}

$B$=$NB>$N%*%Z%l!<%7%g%s$H$7$F$O!"%3%s%]!<%M%s%H$r@8@.$9$k%U%!%/%H%j$N%j%9%H$r<hF@$9$k(B \verb|component_factory_list()| $B$d!"8=:_%$%s%9%?%s%92=$5$l$F$$$k%3%s%]!<%M%s%H$N%j%9%H$r<hF@$9$k(B \verb|component_list()|$B$,$"$j$^$9!#(B

\begin{tab}{$B!|(B $B$=$NB>$N%*%Z%l!<%7%g%s(B}
\begin{tabular}{ll}
\verb|component_factory_list();| & $B%3%s%]!<%M%s%H%U%!%/%H%j$N%j%9%H(B\\
\verb|component_list();|  & $B%3%s%]!<%M%s%H$N%j%9%H(B\\
\verb|command(in string cmd, out string ret);|  & $B4J0W%3%^%s%I%$%s%?%W%j%?(B\\
\end{tabular}
\end{tab}


\section{OpenRTM\--aist$B$N3HD%%*%Z%l!<%7%g%s$HI8=`2=(B}

$B8=:_!"(BRTM Specification $B$OI8=`2=:n6H$NESCf$G$"$j!"$3$3$G<($7$?%$%s%?!<%U%'!<%9;EMM$O:#8eJQ$o$k2DG=@-$,$"$j$^$9!#(B
$BI8=`2=$r9T$&2aDx$G!"<B:]$KB?$/$N%"%W%j%1!<%7%g%s$K;HMQ$7$?7k2L$+$i$N%U%#!<%I%P%C%/$rF@$F!"$h$j<BMQE*$G;H$$$d$9$$I8=`;EMM$H$9$k$3$H$rL\;X$7$F$$$^$9!#(B

OpenRTM\--aist $B$G3HD%$5$l$?;EMM$b!":#8eJQ99$5$l$k2DG=@-$,$"$j$^$9!#(B
$B0lIt$N$b$N$O(B RTM Specification $B$K<h$j9~$^$l!"3HD%$5$l!"$"$k$$$O:o=|$5$l$k$+$b$7$l$^$;$s!#(B
